import { AxiosResponse } from "axios";
import request from "@/api/axios/request";
import dynamic_router_ts from "@/router/modules/dynamic-router";
import dynamic_router_json from "@/assets/json/dynamic-router.json";

// export const loginApi = (data: UserType): Promise<AxiosResponse<UserType>> => {
//     return request.post('/user/login', { data })
// }

// // * 获取菜单列表
// export const getAuthMenuListApi = () => {
//     // axios.get()
//     // 本地菜单
//     return DynamicRouter;

//     // 网络菜单
//     // return request.get<MenuOptions[]>(`/menu/list`, {});
// };

export const useAxiosApi = () => {
    // const loginApi = (data: UserType): Promise<AxiosResponse<UserType>> => {
    //     return request.post('/user/login', { data })
    // }
    const loginApi = (data: any): Promise<AxiosResponse<UserType>> => {
        // return request.post('/user/login', { data })
        console.log(`data = ${data}`);
        return {} as Promise<AxiosResponse<UserType>>;
    };

    const auth_menu_list_local = () => {
        return dynamic_router_ts;
    };

    const auth_menu_list_web = () => {
        return request.get<MenuOptions[]>(`/menu/list`, {});
    };

    return {
        loginApi,
        auth_menu_list_local,
        auth_menu_list_web,
    };
};
